package cn.ithers.blog.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name = "tb_comment")
public class Comment implements Serializable {

    @ApiModelProperty(value = "评论ID")
    @Id
    private String id;

    @ApiModelProperty(value = "父内容")
    @Column(name = "parent_content")
    private String parentContent;

    @ApiModelProperty(value = "文章ID",required = true)
    @Column(name = "article_id")
    private String articleId;

    @ApiModelProperty(value = "评论内容",required = true)
    @Column(name = "content")
    private String content;

    @ApiModelProperty(value = "用户ID")
    @Column(name = "user_id")
    private String userId;

    @ApiModelProperty(value = "用户头像")
    @Column(name = "user_avatar")
    private String userAvatar;

    @ApiModelProperty(value = "用户名")
    @Column(name = "user_name")
    private String userName;

    @ApiModelProperty(value = "状态（1表示正常,3表示置顶）",required = true)
    @Column(name = "state")
    private String state = "1";

    @ApiModelProperty(value = "评论创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty(value = "评论更新时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "update_time")
    private Date updateTime;


}
